// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Router from 'vue-router'
import raphael from 'raphael'
import store from "./store/index"


// 引入easy-ui
import 'vx-easyui/dist/themes/default/easyui.css';
import 'vx-easyui/dist/themes/icon.css';
import 'vx-easyui/dist/themes/vue.css';
import locale from 'vx-easyui/dist/locale/easyui-lang-zh_CN.js'; 
import EasyUI from 'vx-easyui';
Vue.use(EasyUI,{locale: locale});

import ElementUI from 'element-ui' //element-ui的全部组件
import 'element-ui/lib/theme-chalk/index.css'//element-ui的css
Vue.use(ElementUI) //使用elementUI

import VueDragResize from 'vue-drag-resize' //缩放、拖拽
Vue.component('vue-drag-resize', VueDragResize);
Vue.prototype.$raphael = raphael;


import Meta from 'vue-meta'
Vue.use(Meta)

// 表格自动滚动
import scroll from 'vue-seamless-scroll'
Vue.use(scroll)

// import ApiUrl from "../static/config";
import axios from "axios";
import Qs from "qs";
var baseURL = window.g.serverUrl ;
axios.defaults.headers.post['Content-Type'] = "application/x-www-form-urlencoded";
axios.defaults.transformRequest = [obj => Qs.stringify(obj)];
axios.defaults.baseURL = baseURL;
Vue.prototype.$http  = axios;

import VueCron from 'vue-cron'
Vue.use(VueCron);
Vue.config.productionTip = false


// Add a response interceptor
axios.interceptors.response.use(function (response) {
  // Do something with response data
  return response.data;
}, function (error) {
  // Do something with response error
  return Promise.reject(error);
});
/* eslint-disable no-new */
// import echarts from 'echarts';
// Vue.prototype.$echarts =  echarts
// echarts版本号用的是4.9.0
// echarts-liquidfill 版本号用的是2.0.2


Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
